package yf.mall.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import yf.mall.entity.DyAccountAuthEntity;
import yf.mall.vo.DyAccountAuthVo;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import java.util.List;
/**
 * 抖音账户授权表Dao
 *
 * 
 *
 * @date Fri Jul 21 14:19:55 CST 2023
 */
@Mapper
public interface DyAccountAuthDao extends BaseDao<DyAccountAuthEntity> {

    List<DyAccountAuthVo> findVo(DyAccountAuthVo vo);

    DyAccountAuthVo getVo(Long id);


    /**
     * 根据openid查询授权用户信息
     * @param openIds
     * @return
     */
    List<DyAccountAuthEntity> getAuthByOpenIds(@Param("openIds") List<String> openIds);

    @Select("select * from dy_account_auth where  user_id = #{userId} and master = #{master} limit 1")
    DyAccountAuthEntity findByUserIdAndMaster(@Param("userId") Long userId, @Param("master") Integer master);
    @Select("select * from dy_account_auth where  user_id = #{userId}")
    DyAccountAuthEntity findByUserId(@Param("userId") Long userId);

    @Select("select * from dy_account_auth")
    List<DyAccountAuthEntity> findAll();

}
